package com.littleken.test;


import com.littleken.dao.impl.UserUserDaoImpl;
import com.littleken.entity.User;
import org.junit.Test;

import java.util.List;

/**
 * 单元测试
 */
public class test {
   @Test
    public void test(){
        System.out.println("tese");
    }

/*    @Test
    public void testsql(){
        List<User> lists = new ArrayList<>();
        User user = null;
       try{
           ResultSet resultSet = SqlUtil.getResultSet("select * from user");
           while(resultSet.next()){
               Integer id = resultSet.getInt(1);
               String username = resultSet.getString(2);
               String password = resultSet.getString(3);
               Integer sex = resultSet.getInt(4);
               String telephone = resultSet.getString(5);
               String mail = resultSet.getString(6);
               user = new User(id,username,password,sex,telephone,mail);
               lists.add(user);
           }
       }catch (Exception e){
           e.printStackTrace();
       }
        System.out.println(lists);
    }*/

    @Test
    public void testsql2(){
        UserUserDaoImpl dao = new UserUserDaoImpl();
        List<User> allUser = dao.getAllUser();
        System.out.println(allUser);
    }

    @Test
    public void testSql3(){
        UserUserDaoImpl dao = new UserUserDaoImpl();
        User user = dao.getUserById(1);
        System.out.println(user);
    }

    @Test
    public void testsql4(){
        UserUserDaoImpl dao = new UserUserDaoImpl();
        User user = dao.getUserByUsername("littleken");
        System.out.println(user);
    }
}
